package com.example.demo.controller;

import com.example.demo.pojo.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;


@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @GetMapping(value = "getAllUser")
    public ArrayList<User> getAllUser(){
        return userService.getUserList();
    }
    @GetMapping(value = "getOneUser")
    public ArrayList<User> getUserInfoById(){
        return userService.getUserList();
    }
}
